Global Index
HTML5 JS API Index > DOM Tutorials & Specs

DocumentFragment

Extends Node. Implements NonElementParentNode, ParentNode.

Extended by DocumentFragment (Selectors), ShadowRoot

A DocumentFragment node can have an associated element named host.

Properties
unsigned long
childElementCount
The childElementCount attribute must return the number of children of the context object that are elements.
HTMLCollection
children
The children attribute must return an HTMLCollection collection rooted at the context object matching only element children.
Element?
firstElementChild
The firstElementChild attribute must return the first child that is an element, and null otherwise.
Element?
lastElementChild
The lastElementChild attribute must return the last child that is an element, and null otherwise.
Constructor
DocumentFragment()
Operations
voidappend((Node or DOMString) nodes...)
Element?
getElementById(DOMString elementId)
The getElementById(elementId) method must return the first element, in tree order, within context object's descendants, whose ID is elementId, and null if there is no such element otherwise.
voidprepend((Node or DOMString) nodes...)
Element?
query(DOMString relativeSelectors)
The query(relativeSelectors) method must return the first result of running match a relative selectors string relativeSelectors against a set consisting of context object, and null if the result is an empty list.
Elements
queryAll(DOMString relativeSelectors)
The queryAll(relativeSelectors) method must return an Elements array initialized with the result of running match a relative selectors string relativeSelectors against a set consisting of context object.
Element?
querySelector(DOMString selectors)
The querySelector() methods on the Document, DocumentFragment, and Element interfaces must return the first matching Element node within the subtrees of the context node. If there is no matching Element, the method must return null.
Element?
querySelector(DOMString selectors)
The querySelector(selectors) method must return the first result of running scope-match a selectors string selectors against the context object, and null if the result is an empty list otherwise.
NodeList
querySelectorAll(DOMString selectors)
The querySelectorAll() methods on the Document, DocumentFragment, and Element interfaces must return a NodeList containing all of the matching Element nodes within the subtrees of the context node, in document order. If there are no matching nodes, the method must return an empty NodeList.
NodeList
querySelectorAll(DOMString selectors)
The querySelectorAll(selectors) method must return the static result of running scope-match a selectors string selectors against the context object.
Referenced by
DocumentcreateDocumentFragment()
HTMLTemplateElementcontent
RangeextractContents()